-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
State sync support #5803
State sync support #5803
Conversation
Adds the ABCI interface for [state sync](#828) as outlined in [ADR-053](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-053-state-sync-prototype.md), and bumps ABCIVersion to `0.17.0`. The interface adds a new ABCI connection which Tendermint can use to query and load snapshots from the app (for serving snapshots to other nodes), and to offer and apply snapshots to the app (for state syncing a local node from peers). Split out from the original PR in #4645, state sync reactor will be submitted as a separate PR. The interface is implemented by the Cosmos SDK in cosmos/cosmos-sdk#5803.
Fixes #828. Adds state sync, as outlined in [ADR-053](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-053-state-sync-prototype.md). See related PRs in Cosmos SDK (cosmos/cosmos-sdk#5803) and Gaia (cosmos/gaia#327). This is split out of the previous PR #4645, and branched off of the ABCI interface in #4704. * Adds a new P2P reactor which exchanges snapshots with peers, and bootstraps an empty local node from remote snapshots when requested. * Adds a new configuration section `[statesync]` that enables state sync and configures the light client. Also enables `statesync:info` logging by default. * Integrates state sync into node startup. Does not support the v2 blockchain reactor, since it needs some reorganization to defer startup.
Adds the ABCI interface for [state sync](#828) as outlined in [ADR-053](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-053-state-sync-prototype.md), and bumps ABCIVersion to `0.17.0`. The interface adds a new ABCI connection which Tendermint can use to query and load snapshots from the app (for serving snapshots to other nodes), and to offer and apply snapshots to the app (for state syncing a local node from peers). Split out from the original PR in #4645, state sync reactor will be submitted as a separate PR. The interface is implemented by the Cosmos SDK in cosmos/cosmos-sdk#5803.
Fixes #828. Adds state sync, as outlined in [ADR-053](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-053-state-sync-prototype.md). See related PRs in Cosmos SDK (cosmos/cosmos-sdk#5803) and Gaia (cosmos/gaia#327). This is split out of the previous PR #4645, and branched off of the ABCI interface in #4704. * Adds a new P2P reactor which exchanges snapshots with peers, and bootstraps an empty local node from remote snapshots when requested. * Adds a new configuration section `[statesync]` that enables state sync and configures the light client. Also enables `statesync:info` logging by default. * Integrates state sync into node startup. Does not support the v2 blockchain reactor, since it needs some reorganization to defer startup.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
leave it open |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I've ported this to the latest SDK+Tendermint target in the |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Superseded by #7166. |
Adds the ABCI interface for [state sync](tendermint/tendermint#828) as outlined in [ADR-053](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-053-state-sync-prototype.md), and bumps ABCIVersion to `0.17.0`. The interface adds a new ABCI connection which Tendermint can use to query and load snapshots from the app (for serving snapshots to other nodes), and to offer and apply snapshots to the app (for state syncing a local node from peers). Split out from the original PR in #4645, state sync reactor will be submitted as a separate PR. The interface is implemented by the Cosmos SDK in cosmos/cosmos-sdk#5803.
Description
Fixes #5689, fixes #5690. Adds support for taking, restoring, and serving snapshots for state sync, as outlined in ADR-053 and the ABCI reference.
rootmulti.Store
now implements a newsnapshots.Snapshotter
interface, which can take and restore binary state snapshots at a given height. Snapshots are built as follows:rootmulti.Store
iterates over alliavl.Store
stores, and for each one emits a delimited ProtobufSnapshotStoreItem
message with store metadataFor each
iavl.Store
, exportiavl.ExportNode
nodes viaExport()
at the given height and emit a delimited ProtobufSnapshotIAVLItem
message for each nodeThe delimited Protobuf message stream is zlib-compressed
The zlib-compressed stream is chunked naïvely into 10 MB chunks
snapshots.Store
stores snapshot metadata in a separate database and chunks in a filesystem directoryBaseApp
takes asynchronous snapshots afterCommit()
in regular height intervals given by the config optionstate-sync.snapshot-interval
(default 0, i.e. disabled). It also prunes old snapshots, and keeps the most recent snapshots given by the optionstate-sync.snapshot-keep-recent
(default 2).BaseApp
implements the upcoming state sync ABCI interface from Tendermint, for fetching and applying state snapshots.SimApp
has been updated to enable and initialize state sync snapshots.